package com.dongge.Entity;

/**
 * Created by zhudong on 2016/7/6.
 */
public class A {
    private B b;
    public A() {
        System.out.println("construction A is calling");
    }

    public A(B b) {
        this.b = b;
        System.out.println("Injection by Construction");
    }

    public void print(){
        System.out.println("A print");
        b.talk();
    }

    public B getB() {
        return b;
    }

    public void setB(B b) {
        this.b = b;
    }
}
